package com.zhang.config;

import com.zhang.domain.TestBean4;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration
@PropertySource("classpath:test.properties")
public class TestConfig1 {

    @Value("${zz.name}")
    private String name;
    @Value("${zz.address}")
    private String address;
    @Value("${zz.email}")
    private String email;
    @Value("${zz.phone}")
    private String phone;

    @Bean
    public TestBean4 testBean4() {
        System.out.println("name:" + name);
        System.out.println("address:" + address);
        System.out.println("email:" + email);
        System.out.println("phone:" + phone);
        return new TestBean4();
    }
}
